//
//  InServeiCompanyFirCell.m
//  u76ho
//
//  Created by m-air-01 on 16/1/4.
//  Copyright © 2016年 LV. All rights reserved.
//

#import "InServeiCompanyFirCell.h"

@implementation InServeiCompanyFirCell

- (void)awakeFromNib {
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}
-(void)setCommendInfomodel:(AllCommendInfoModel *)commendInfomodel
{
    for (id i in self.subviews) {
        if ([i isKindOfClass:[UILabel class]]) {
            [i removeFromSuperview];
        }
    }
    
    UILabel * userNameLab = [[UILabel alloc]initWithFrame:CGRectMake(SIZETO6W(15), 5, 200, 20)];
    userNameLab.text = commendInfomodel.username;
    [self addSubview:userNameLab];
    
    _commendInfomodel = commendInfomodel;
    CGFloat tempHeight = [commendInfomodel.content heightOfSize:17 width:(SCREEN_WIDTH - 53 - SIZETO6W(15))];
    UILabel * contentLab = [[UILabel alloc]initWithFrame:CGRectMake(userNameLab.left, userNameLab.bottom, (SCREEN_WIDTH - 53 - SIZETO6W(15)), tempHeight+10)];
    contentLab.text = commendInfomodel.content;
    contentLab.numberOfLines = 0;
    contentLab.textColor = UIColorFromRGB(0xA3A3A3);
    contentLab.font = [UIFont systemFontOfSize:16];
    [self addSubview:contentLab];
}

-(void)setDynaCommendInfomodel:(DynaCommendModel *)dynaCommendInfomodel
{
    for (id i in self.contentView.subviews) {
        
        if ([i isKindOfClass:[UILabel class]]) {
            [i removeFromSuperview];
        }
    }
    
    UILabel * userNameLab = [[UILabel alloc]initWithFrame:CGRectMake(SIZETO6W(15), 5, 200, 20)];
    userNameLab.text = dynaCommendInfomodel.username;
    [self.contentView addSubview:userNameLab];
    
    _dynaCommendInfomodel = dynaCommendInfomodel;
    CGFloat tempHeight = [dynaCommendInfomodel.content heightOfSize:17 width:(SCREEN_WIDTH - 53 - SIZETO6W(15))];
    UILabel * contentLab = [[UILabel alloc]initWithFrame:CGRectMake(userNameLab.left, userNameLab.bottom, (SCREEN_WIDTH - 53 - SIZETO6W(15)), tempHeight+10)];
    contentLab.text = dynaCommendInfomodel.content;
    contentLab.numberOfLines = 0;
    contentLab.textColor = UIColorFromRGB(0xA3A3A3);
    contentLab.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:contentLab];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    //
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
